home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1987 January & February
/
rerun-1987-01-02.d64
/
envelope maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
73 lines
100 te=0:pdev=4:sa=7:rem set te to 1 if you have a 1526 printer
110 poke53280,0:poke53281,0:printchr$(14):printchr$(30):print"[147]"
120 sub=49152:forj=subtosub+76:readn:cs=cs+n:pokej,n:next
130 ifcs<>10586thenprint"error in data statements.":end
140 close4:open4,pdev,sa:b$=" ":b$=b$+b$+b$+b$
150 print"[147]"tab(13)"[197][206][214][197][204][207][208][197][160][205][193][203][197][210]":fork=1to6:readw(k):next
160 t$(1)="1) [211]tandard [204]etter":t$(2)="2) [198]rench [198]old"
170 print""tab(9)"[195]hoose envelope type:":gosub710
180 a$="":geta$:if(a$<>"1")and(a$<>"2")then180
190 et=val(a$):t$(et)=""+t$(et):print"[145][145][145][145][145][145][145][145]":gosub710
200 if et=1 then w(1)=64:w(2)=w(2)-4:w(5)=w(5)-5:w(6)=w(6)-2
210 if te then w(1)=w(1)+4:if et=1 then w(3)=w(3)-2
220 forj=1to4:readt$(j):next
230 print" [213]se default return address";:gosub680
240 ifa$="y"then270
250 ifa$<>"n"then230
260 p$=" return":gosub610
270 forj=1to4:r$(j)=t$(j):next
280 p$="":gosub610:fork=1to4:ad$(k)=t$(k):next
290 print" [195]enter address lines";:gosub680:cf=(a$="y")
300 if cf then330
310 ci=0:forj=1to4:iflen(ad$(j))>cithenci=len(ad$(j))
320 next
330 print" [208]ress any key to begin printing."
340 a$="":geta$:ifa$=""then340
350 s=5:print#4,mid$(b$,1,w(3)+s+2);
360 forj=1tow(1)-2*s:print#4,"-";:next:print#4
370 forj=s to 1 step -1
380 print#4,mid$(b$,1,j+w(3))"."mid$(b$,1,w(1)-2*j+2)".":next
390 forj=1tow(4)-s:print#4,mid$(b$,1,w(3)+1)":"mid$(b$,1,w(1))":":next
400 gosub660:s=w(3):f1=s:f2=s:forj=1tow(2)
410 y=1+(-1*(j<=s))+(-1*(j<=(w(2)-s))):on y goto440,430,420
420 x$=":":iff1thenx$=".":x=f1:goto450
430 print#4,":"mid$(b$,1,s);:goto460
440 x$=":":iff2thenx$=".":x=s-f2+1
450 print#4,mid$(b$,1,x)"."mid$(b$,1,s-x);
460 z$="":if(j>1)and(j<6)thenz$=" "+r$(j-1):goto500
470 if(j<w(6))or(j>w(6)+6)or(int(j/2)<>j/2)then500
480 z$=ad$((j-w(6))/2+1):cz=len(z$):ifcf=0thencz=ci
490 x=int((w(1)-cz)/2):z$=mid$(b$,1,x)+z$
500 z=len(z$):z$=z$+mid$(b$,1,w(1)-z):print#4,":"z$":";
510 x$=":":on y goto540,530,520
520 iff1thenx$=".":x=f1:f1=f1-1:goto550
530 x=0:goto550
540 iff2thenx$=".":x=s-f2+1:f2=f2-1
550 print#4,mid$(b$,1,s-x);x$
560 next:gosub660:forj=1tow(5)
570 print#4,mid$(b$,1,w(3)+1)":"mid$(b$,1,w(1))":":next
580 gosub660:forj=1to6:print#4:next:print" [205]ake another";:gosub680
590 ifa$="y"then280
600 print#4:close4:end
610 print"":x$="[197]nter"+p$+" address lines:":printtab((40-len(x$))/2)x$""
620 z=w(1)-1:for j=1 to 4
630 printmid$(str$(j),2)"> ";:syssub,t$(j):print:print
640 iflen(t$(j))>z thenprint"[204]ine too long, max is"z"chars. [210]eenter."
650 next:return
660 print#4,mid$(b$,1,w(3)+2);
670 forj=1tow(1):print#4,"-";:next:print#4:return
680 print" [y/n]? ";
690 a$="":geta$:if(a$<>"y")and(a$<>"n")then690
700 printmid$("yesno ",-1*(a$="y")-4*(a$="n"),3):forj=1to80:next:return
710 printtab(11)""t$(1):printtab(11)""t$(2)"":return
720 data 32,253,174,32,139,176,133,251,132,252,32,143,173,160,0,32,207,255
730 data 201,13,240,6,153,0,2,200,208,243,192,1,208,8,173,0,2,201,32,208,1,136
740 data 132,253,152,32,125,180,165,99,160,2,145,251,136,165,98,145,251,136
750 data 165,97,145,251,165,253,240,10,185,0,2,145,98,200,196,253,208,246,96
760 data 57,26,6,13,19,14
770 rem default return address
780 data "[205]ichael [194]roussard"
790 data "13136 [204]azy [199]len [195]ourt"
800 data "[200]erndon, [214]irginia 22071-2326"
810 data ""